package com.bxs.detector;

import com.bxs.pojo.DangerMsg;
import com.bxs.pojo.BaseRule;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.pcap4j.core.PcapPacket;

import java.io.UnsupportedEncodingException;
import java.util.List;

public abstract class BaseDetector {
//    protected List<BaseRule> rules = new ArrayList<>();
    // 每个检测器实现detect方法
    public abstract DangerMsg detect(PcapPacket packet, List<BaseRule> rules) throws JsonProcessingException, UnsupportedEncodingException;

//    public void register(BaseRule rule){
//        rules.add(rule);
//    }

    // 清空规则
//    public void reset(){
//        rules.clear();
//    }
}
